<template>
  <div>
    <h1>子组件</h1>
    <h1>{{ myname }}</h1>
  </div>
</template>
<script>
import { inject } from 'vue'
export default {
  setup (props) {
    let myname = inject('cname')
    return {
      myname
    }
  }
}
</script>
<style lang="less"></style>
